/*
 * File Name : file_system.h
 * Auther : dream.liuguobiao
 * Create Date : 2010-5-7
 * Last Edit : 2010-5-10
 */

#ifndef FILE_SYSTEM_H
#define FILE_SYSTEM_H

#include <vector>
#include "node.h"

class file_system
{
private:
  node *root ;
  node *current_directory ;
  std::vector<node*> find_return;
  static file_system *instance_file_system ;
  bool create_system_tree();
  void do_find( std::string *node_name , node *current_node );

  file_system();

public:
  static file_system *get_file_system();
  node *get_root();
  node *get_current_directory();
  bool set_current_directory( node *new_current_directory );

  std::vector<node *> *find_node( node *start_node ,std::string *node_name );
  node *find_node_just_current_directory( std::string *node_name );
  bool insert_node( node *node );
  int delete_node ( std::string *node_name  ,int current_user_ID);
};

#endif
